import sys,os
sys.path.append(os.path.realpath('../myfunctions'))

import vc_gen_class as vgc

import mc_functions as mcf

import pdb
import numpy as np
from scipy import *
import time

# ------------------- DICTIONARIES

#pdb.set_trace()

Syn_exc_par={}
Syn_inh_par={}
Noise_par={}
Fr_par={}
Init_par={}
Sim_par={}

# ------------------- SYNAPTIC PARAMETERS


# --------- Excitatory
Syn_exc_par['tau1']=0.0003; # seconds
Syn_exc_par['tau2']=0.002; # seconds
Syn_exc_par['Bee']= 1; # in pA
Syn_exc_par['Beestd']=Syn_exc_par['Bee']*0.8; 
Syn_exc_par['WeightDist']='LogNormal'; #Normal/LogNormal


# --------- Inhibitory
Syn_inh_par['tau1']=0.0003; # seconds
Syn_inh_par['tau2']=0.002; # seconds
Syn_inh_par['Bei']= 1 ; # in pA
Syn_inh_par['Beistd']=Syn_inh_par['Bei']*0.8; 
Syn_inh_par['WeightDist']='Normal'; #Normal/LogNormal


# ---------------------------- NOISE PARAMETERS

Noise_par['ampli']=5; # noise amplitude in pA
Noise_par['tau']=0.0005; # time constant in sec
Noise_par['sigma']=2; # standard deviation
Noise_par['mu']=0; # average

# ---------------------------- FREQUENCY PAR

Fr_par['e']=500.;
Fr_par['i']=0.;


# ---------------------------- INITIALIZATION PAR
Init_par['Ioffset']=(-50.0 ) # excitatory current offset in pA

# ---------------------------- SIMULATION PAR

Sim_par['duration']=4.
Sim_par['dt']=0.00001





# ---------------------------- STARTING

v1=vgc.VCGeneration(Syn_exc_par,Syn_inh_par,Noise_par,Fr_par,Init_par,Sim_par);

v1.reset();

t=np.array(arange(0,4,0.001))
r=30*ones(t.shape)

st,amp=v1.run(4)

tspike=mcf.inhom_poisson(r,t)

